package com.mxl.threadtest;

public class ThreadTest {
    public static void main(String[] args) {
        Thread myThread = new MyThread();
        myThread.start();

        Thread myRunnable = new Thread(new MyRunnable());
        myRunnable.start();
    }
}

/**
 * 继承Thread创建的线程
 */
class MyThread extends Thread{
    @Override
    public void run() {
        System.out.println("是我的MyThread!");
    }
}

/**
 * 实现Runnable接口创建的线程
 */
class MyRunnable implements Runnable{

    @Override
    public void run() {
        System.out.println("是我的MyRunnable!");
    }
}

